package cn.itcast.ssm.controller;

import cn.itcast.ssm.vo.CustomList;
import cn.itcast.ssm.vo.UserList;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

/**
 * Description:
 * Created by t410 on 2017/6/30.
 */
@Controller
@RequestMapping("/conveyParameter")
public class ConveyParameter {
    private String successJsp="success";

    @RequestMapping(value="/simpleArray.action")
    public String simpleArray(String[] titleName, Map map){
        for (int i = 0; i < titleName.length; i++) {
            System.out.println(titleName[i]);
        }
        map.put("v1","array");
        return successJsp;
    }

    @RequestMapping(value="/wrappedList.action")
    public String wrappedList(UserList userList, Map map){
        for (int i = 0; i < userList.getUserList().size(); i++) {
            System.out.println(userList.getUserList().get(i));
        }
        map.put("v1","wrappedList");
        return successJsp;
    }

    @RequestMapping(value="/simpleList.action")
    public String simpleList(CustomList customList, Map map){
        for (int i = 0; i < customList.getTitleName().size(); i++) {
            System.out.println(customList.getTitleName().get(i));
        }
        map.put("v1","list");
        return successJsp;
    }
}
